package com.zxy.ziems.server.gasification.controller;

import com.zxy.ziems.server.dto.DataQueryDto;
import com.zxy.ziems.server.energy.enums.EnergyDataTypeEnum;
import com.zxy.ziems.server.energy.service.DataChartDictService;
import com.zxy.ziems.server.gasification.service.GasificationService;
import com.zxy.ziems.server.vo.ChartVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 动力各科-气化科
 *
 * @author chdzq
 * @create 2023/4/13
 */
@RestController
@Validated
@RequestMapping("/api/gasification")
public class GasificationController {
    @Autowired
    private DataChartDictService dataChartDictService;
    @Autowired
    private GasificationService gasificationService;

    /**
     * 系统水耗
     *
     * @return
     */
    @GetMapping("/water")
    public ChartVo coolingTower(DataQueryDto dataQueryDto) {
        return dataChartDictService.thisData(dataQueryDto);
    }

    /**
     * 系统电耗
     *
     * @return
     */
    @GetMapping("/electric")
    public ChartVo mediumTemperatureChilledWater(DataQueryDto dataQueryDto) {
        return dataChartDictService.childData(dataQueryDto);
    }

    /**
     * 压缩空气各分厂流量
     *
     * @return
     */
    @GetMapping("/compressedAir")
    public ChartVo compressedAir(DataQueryDto dataQueryDto) {
        return gasificationService.compressedAir(dataQueryDto);
    }


    /**
     * 大宗气体计量N2(费用)
     *
     * @return
     */
    @GetMapping("/largeGasN2")
    public ChartVo largeGasN2(DataQueryDto dataQueryDto) {
        dataQueryDto.setDataType(EnergyDataTypeEnum.CODE.getCode());
        return dataChartDictService.thisData(dataQueryDto);

    }


    /**
     * 大宗气体计量
     *
     * @return
     */
    @GetMapping("/largeGas")
    public ChartVo largeGas(DataQueryDto dataQueryDto) {


        return dataChartDictService.compareBarChart(dataQueryDto);
    }


}

